﻿using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Text;
using System.Threading.Tasks;

using RexToy;
using RexToy.IoC;
using RexToy.UI.WinForm.Controls;
using RexToy.UI.WinForm.Pmlx;

using MGAS.Model;
using MGAS.Model.Entity;

namespace MGAS.UI.Controls
{
    public class FrmHistory : Form
    {
        [PmlxBoundControl("lvHistory")]
        protected DetailListView _lvHistory;

        public int SensorID { get; set; }

        public FrmHistory()
        {
        }

        protected override void OnLoad(EventArgs e)
        {
            var _ctx = new Kernal("main");            
            var mgr = _ctx.Lookup<IHistoryManager>();

            this._lvHistory.Bind(mgr.FindHistoryByAddress(this.SensorID));
        }
    }
}
